﻿Imports Microsoft.VisualBasic

Imports Microsoft.VisualStudio.TestTools.UnitTesting

Imports cerveza



'''<summary>
'''This is a test class for ProductoNegocioTest and is intended
'''to contain all ProductoNegocioTest Unit Tests
'''</summary>
<TestClass()> _
Public Class ProductoNegocioTest


    Private testContextInstance As TestContext

    '''<summary>
    '''Gets or sets the test context which provides
    '''information about and functionality for the current test run.
    '''</summary>
    Public Property TestContext() As TestContext
        Get
            Return testContextInstance
        End Get
        Set(ByVal value As TestContext)
            testContextInstance = Value
        End Set
    End Property

    '''<summary>
    '''A test for insertar
    '''</summary>
    Public Sub ListarTest()
        Dim negocio As New ProductoNegocio()
        Dim todos = negocio.listar()

    End Sub



    Public Sub insertarTest()
        Dim negocio As New ProductoNegocio()

        Try
            Dim modelo = negocio.insertar("brahma", "cerveza", "25", "20-12-5", 12)

            Console.Write(modelo.idProducto)



        Catch ex As DAOExcepcion
            Assert.Fail(ex.ToString())
        End Try

    End Sub

    <TestMethod()> _
    Public Sub eliminarTest()
        Dim negocio As New ProductoNegocio()

        Try
            negocio.eliminar(5)
        Catch ex As Exception
            Assert.Fail(ex.ToString())
        End Try
    End Sub

End Class
